home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / wxmodem.zip / WXMODEM.PAS < prev    next >
Pascal/Delphi Source File  |  1986-11-06  |  3KB  |  116 lines

  1. {$U-,C-,R-}
  2. program WXMODEM;
  3. {
  4. Peter Boswell
  5. }
  6. Const
  7.      VERSION = '4.0';
  8.  
  9. type
  10.     bigstring        = string[80];    {general purpose}
  11.     cset             = set of 0..127;
  12. var
  13.    transmit,
  14.    pcjrmode              : boolean;
  15.    exitfl,
  16.    testfl,
  17.    good,
  18.    xtnd                  : boolean;
  19.    displayfl   : boolean;
  20.    a                     : byte;
  21.    c,i                   : integer;
  22.    fmin, fsec            : integer;
  23.    xmofile               : bigstring;
  24.    bytes                 : bigstring;
  25.    rbytes                : real;
  26.    ch, xmotype           : char;
  27.  
  28. {$C-,R-,U-,K-}
  29. {$I WXMOPORT.INC}
  30. {$I WXMOMISC.INC}
  31. {$I WXMOWIND.INC}
  32. {$I WXMOXFER.INC}
  33. {$I WXMODIAL.INC}
  34.  
  35.  
  36. begin
  37.      displayfl := false;
  38.      ScreenBase := $B000;                       {assume monochrome}
  39.      MemW[ ScreenBase:0000 ]   := 69;
  40.      if Mem[ ScreenBase:0000 ] <> 69 then
  41.         ScreenBase := $B800;
  42.      exitfl := true;
  43.      setup;
  44.      if displayfl then
  45.      begin
  46.          LowVideo;
  47.          ClrScr;
  48.          InitWindow(StatWin,1,1,80,2);
  49.          InitWindow(TermWin,1,3,80,25);
  50.          CurrentWin := TermWin;
  51.          UsePermWindow(TermWin);
  52.          status(1,'WXMODEM ver: ' + VERSION);
  53.          status(2,'Initializing');
  54.      end;
  55.      init_port;
  56.      term_ready(true);
  57.      set_up_recv_buffer;
  58.      remove_port;
  59.      init_port;
  60.      term_ready(true);
  61.      set_up_recv_buffer;
  62.      good := false;
  63.      if displayfl then
  64.      begin
  65.           GotoXY(1,1);
  66.           if carrier then
  67.              status(2,'On-Line/Ready')
  68.           else
  69.              status(2,'Off-Line/Ready');
  70.           status(3,'TCOMM Support');
  71.      end;
  72.      if scan(xtnd,a) then
  73.      begin
  74.           if xtnd then
  75.           begin
  76.              case a of
  77.                   45   : {alt-X}
  78.                          begin
  79.                               if displayfl then
  80.                                  OpenTemp(20,18,60,22,1);
  81.                               writeln('───WXMODEM───');
  82.                               write('Do you really want to exit (Y/N)? ');
  83.                               readln(ch);
  84.                               if upcase(ch) = 'Y' then
  85.                                  exitfl := TRUE;
  86.                               if displayfl then
  87.                                  CloseTemp
  88.                          end;
  89.                   48   : {alt-B}
  90.                          break;
  91.              end; {case}
  92.           end     {if extended key}
  93.      end; {if KeyPressed}
  94.      if (exitfl = false) and carrier then
  95.         case transmit of
  96.             false : recv_wcp;
  97.             true  : send_wcp;
  98.         end;
  99.      assign(cmfile,cmdfname);
  100.      {$I-} Rewrite(cmfile) {I+};
  101.      if IOresult = 0 then
  102.      begin
  103.          if good then
  104.          begin
  105.             rbytes := 128.0 * tblks;
  106.             str(rbytes:7:0,bytes);
  107.             writeln(cmfile,'0 '+xmofile+' '+bytes);
  108.             {$I-} close(cmfile); {$I+}
  109.             If IOresult <> 0 then
  110.               writeln('WXTERM - error rewriting parm file');
  111.          end;
  112.       end;
  113.  
  114.      remove_port;
  115. end.
  116.